package java101;

public class FibNew {

	public static void main(String[] args) {

//		for (int i = 0, fib[] = new int[30]; i< fib.length; i++){
////			System.out.println(i);
////			fib[i] = fib[i-1] + fib[i-2];
//			if (i > 2) {
//				
//				System.out.println(fib[i] = (i<2) ? i : fib[i-1] + " + " + fib[i-2] + " = " + fib[i-1] + fib[i-2]);
////				System.out.println(String.format("%d + %d = %d", fib[i-1], fib[i-2], fib[i-1] + fib[i-2]));
//				}
//			else if (i < 1){
//				System.out.println(String.format("%d + %d = %d\n%d + %d = %d", 0, 1, 1, 1, 1, 2));
//			}
//			
		for (int i = 0, fib[] = new int[30]; i< fib.length; i++){
			fib[i] = fib[i-1] + fib[i-2];
			System.out.println(String.format(fib[i] = (i<2 ? "%d" : "%d plus %d equals %d", i, fib[i-1], fib[i-2], fib[i], fib[i-1])));
		}
		

	}

}
